#include <iostream>
#include <map>
#include <string>
using namespace std;

int main()
{
  map <string,size_t> m;
  string s;
  
  while(cin >> s)
    { 
      m[s]++;
    }
  
  map <string,size_t>::iterator i = m.begin();
  
  while(i != m.end())
    {
      cout << i->first << " - " << i->second << endl;
      i++;
    }
  
  return 0;
}

